<%-------------------------------------------------------------------
 * 页面名称：forgotLoginPass.jsp
 * 功能描述：忘记登录密码
 * Action  :
 *
 *-------------------------------------------------------------------
--%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%
	String path = request.getContextPath();

	String r = null;
	if (request.getParameter("r") != null) {
		r = request.getParameter("r").toString();
	}
%>
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/font.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/newstyle.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.box {width:100%;margin:auto;}
.off {margin-left:3px;line-height:34px;float:left;width:300px;height:34px;color:#0099CC;font-size:14px;font-weight:bold;text-align:center;background-color:#DCDEDD;cursor: hand;}
.on {margin-left:3px;line-height:34px;float:left;width:300px;height:34px;color:#0099CC;font-size:14px;font-weight:bold;text-align:center;border-top: 1px #CCCCCC solid;border-left:1px #CCCCCC solid;border-right: 1px #CCCCCC solid;cursor: hand;}
.tab {width:100%;margin:auto;float:left;}
-->
</style>
<script type='text/javascript' src='<%=path%>/js/vnv/commonForManage.js'></script>
<script language="javascript">
	function applyByEmail() {
		if (emptyValidate(getObj("email"),"Email地址") != "") {
			return false;
		}
		//if (!checkEmail(getObj("email"))) {
		//	alert("Email地址格式不正确，请重新填写！");
			//return false;
		//}
		var emailregx="^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$";
		if(!RegExp(emailregx).test(getObj("email").value)){
		     alert("Email地址格式不正确，请重新填写！");
			return false;
		 }
		if (emptyValidate(getObj("emailVericode"),"校验码") != "") {
			return false;
		}
		document.forms[0].action = '<%=path%>/applyResetLoginPasswordByEmail.do';
		document.forms[0].submit();
	}
	function applyByMobile() {
		if (emptyValidate(getObj("mobile"),"手机号码") != "") {
			return false;
		}
		if (!mobileValidate(getObj("mobile"))) {
			return false;
		}
		if (emptyValidate(getObj("mobileVericode"),"校验码") != "") {
			return false;
		}
		document.forms[0].action = '<%=path%>/applyResetLoginPasswordByMobile.do';
		document.forms[0].submit();
	}
	function resetByEmail() {
		location.href = '<%=path%>/toResetLoginPasswordByEmail.do';
	}
	function resetByMobile() {
		location.href = '<%=path%>/toResetLoginPasswordByMobile.do';
	}
	function showTr(showId, hideId) {
		getObj(showId+'Tr1').style.display = 'block';
		getObj(showId+'Tr2').style.display = 'block';
		getObj(showId+'Tr3').style.display = 'block';
		getObj(showId+'Tr4').style.display = 'block';
		getObj(showId+'Tr5').style.display = 'block';
		document.getElementById(showId+'Tab').className = 'on';
		
		getObj(hideId+'Tr1').style.display = 'none';
		getObj(hideId+'Tr2').style.display = 'none';
		getObj(hideId+'Tr3').style.display = 'none';
		getObj(hideId+'Tr4').style.display = 'none';
		getObj(hideId+'Tr5').style.display = 'none';
		document.getElementById(hideId+'Tab').className = 'off';
		
		var now = new Date();
		getObj('verifyImage').src = '<%=path%>/page/util/verifyImage.jsp?now='+now.getTime().toString();
	}
	
</script>
<div id="mainFrame">
	<div class="login_logo">
		<!-- <img src="<%=path%>/images/LOGO-4_a.jpg" /> -->
	</div>
	<div>
		<div>
			<span class="bluefont18bdrop">忘记登录密码 </span>
		</div>
		<div>
			<div>
				<div id="emailTab" onclick="showTr('email', 'mobile');" class="on" >
					使用Email申请重置登录密码
				</div>
				<div id="mobileTab" onclick="showTr('mobile', 'email');" class="off">
					使用手机申请重置登录密码
				</div>
			</div>
			<div></div>
			<div style="clear:both;"></div>
			<div id="cont_1">
				<div style="clear:both;"></div>
				<div id="cont_1">
					<table width="100%" border="0" align="center" cellpadding="5"
						cellspacing="1">
						<html:form method="post"
							action="/applyResetLoginPasswordByEmail.do">
							<tr>
								<td colspan="2" class="font_blue">
									<table width="100%" border="0" align="center" cellpadding="7"
										cellspacing="1" bgcolor="#f9e277" style="margin:10px 0;">
										<tr>
											<td bgcolor="#fffdf5">
												<table width="100%" border="0" cellpadding="3"
													cellspacing="0">
													<tr>
														<td width="3%" height="25" valign="top"
															style="border-bottom:1px solid #ccc;"></td>
														<td width="97%" align="left" class="red12b"
															style="border-bottom:1px solid #ccc;">
															特别提醒
														</td>
													</tr>
													<tr id="emailTr1">
														<td valign="top">
															&nbsp;
														</td>
														<td align="left" class="font_gray">
															如果您的登录账号是使用Email注册的，或者绑定了Email，我们可以将重置登录密码的
															<span class="text9green">确认码发送到您的Email里</span>。
														</td>
													</tr>
													<tr id="emailTr4">
														<td valign="top">
															&nbsp;
														</td>
														<td align="left" class="font_gray">
															如果您已经得到了该邮件，请直接进入下一步，
															<span class="redColor12px">填写您的Email地址</span>，收到的确认码以及重新设置的登录密码。
														</td>
													</tr>
													<tr id="emailTr5">
														<td valign="top">
															&nbsp;
														</td>
														<td align="left" class="font_gray">
															注：仅限于个人用户和企业用户的管理员；企业用户的操作员忘记登录密码，请向本企业的管理员申请重置。
														</td>
													</tr>
													<tr id="mobileTr1">
														<td valign="top">
															&nbsp;
														</td>
														<td align="left" class="font_gray">
															如果您的登录账号是使用手机号码注册的，或者绑定了手机，我们可以将重置登录密码的
															<span class="text9green">确认码发送到您的手机里</span>。
														</td>
													</tr>
													<tr id="mobileTr4">
														<td valign="top">
															&nbsp;
														</td>
														<td align="left" class="font_gray">
															如果您已经得到了该短信，请直接进入下一步，
															<span class="redColor12px">填写您的手机号码</span>，收到的确认码以及重新设置的登录密码。
														</td>
													</tr>
													<tr id="mobileTr5">
														<td valign="top">
															&nbsp;
														</td>
														<td align="left" class="font_gray">
															注：仅限于个人用户。
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr id="emailTr2">
								<td width="40%" align="right">
									<span>*</span>您的Email地址：
								</td>
								<td width="60%">
									<html:text property="email" size="40" styleClass="inputStyle" />
								</td>
							</tr>
							<tr id="mobileTr2">
								<td align="right">
									<span>*</span>您的手机号码：
								</td>
								<td>
									<html:text property="mobile" size="40" styleClass="inputStyle" />
								</td>
							</tr>
							<tr>
								<td align="right">
									<span>*</span>请输入图片里的校验码：
								</td>
								<td bgcolor="#FFFFFF">
									<input name="vericode" type="text" class="inputStyle" />
									<img id="verifyImage" src="<%=path%>/page/util/verifyImage.jsp"
										width="60" height="24" align="absmiddle" />
								</td>
							</tr>
							<tr id="emailTr3">
								<td align="right">
									&nbsp;
								</td>
								<td height="50">
									<input type="button" name="return1" value="获取重置登录密码的确认码"
										class="button_style_l" onclick="applyByEmail();" />
									<input type="button" name="return2" value="直接进入下一步"
										class=button_style_m onclick="resetByEmail();" />
									<input type="button" name="return3" value="返回首页"
										class="button_style"
										onclick="location.href='<%=path%>/main.do';" />

								</td>
							</tr>
							<tr id="mobileTr3">
								<td align="right">
									&nbsp;
								</td>
								<td height="50">
									<input type="button" name="return1" value="获取重置登录密码的确认码"
										class="button_style_l" onclick="applyByMobile();" />
									<input type="button" name="return2" value="直接进入下一步"
										class="button_style_m" onclick="resetByMobile();" />
									<input type="button" name="return3" value="返回首页"
										class="button_style"
										onclick="location.href='<%=path%>/main.do';" />
								</td>
							</tr>
						</html:form>
					</table>
				</div>
			</div>
		</div>
	</div>
	<script language="javascript">
<% if (r!=null && r.equals("m")) { %>
	showTr('mobile', 'email');
<% } else { %>
    showTr('email', 'mobile');
<% } %>
</script>